package com.leezhen.service;

import com.leezhen.commons.config.FeignClientConfig;
import com.leezhen.service.fallback.IDeptServiceFallbackFactory;
import com.leezhen.vo.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(value = "MICROCLOUD-ZUUL-GATEWAY", configuration = FeignClientConfig.class, fallbackFactory = IDeptServiceFallbackFactory.class)
public interface IDeptClientService {

    @RequestMapping(method = RequestMethod.GET, value = "/leezhen-proxy/dept-proxy/dept/get/{id}")
    Dept get(@PathVariable("id") long id);

    @RequestMapping(method = RequestMethod.GET, value = "/leezhen-proxy/dept-proxy/dept/list")
    List<Dept> list();

    @RequestMapping(method = RequestMethod.POST, value = "/leezhen-proxy/dept-proxy/dept/add")
    boolean add(Dept dept);

}
